Skip to content

Conversation

@aztice
Copy link
Contributor

@aztice aztice commented Oct 30, 2025

描述

norm_by_times 以及 zero_infinity 同步于 ctc_loss 函数

详见 PaddlePaddle/Paddle#75742 and PaddlePaddle/Paddle#76156

Added parameters 'norm_by_times' and 'zero_infinity' to ctc_loss function documentation.
@paddle-bot
Copy link

paddle-bot bot commented Oct 30, 2025

感谢你贡献飞桨文档,文档预览构建中,Docs-New 跑完后即可预览,预览链接:http://preview-pr-7597.paddle-docs-preview.paddlepaddle.org.cn/documentation/docs/zh/api/index_cn.html
预览工具的更多说明,请参考:飞桨文档预览工具

@github-actions
Copy link

github-actions bot commented Oct 30, 2025

📚 本次 PR 文档预览链接(点击展开)
ℹ️ 预览提醒
请等待 Docs-NEW 流水线运行完成后再点击预览链接,否则可能会看到旧版本内容或遇到链接无法访问的情况。

Correct formatting of the 'zero_infinity' parameter description in the CTC loss documentation.
Add description for zero_infinity parameter in CTCLoss.
Updated the parameter mapping for PyTorch and PaddlePaddle in the CTCLoss documentation, including the addition of the 'zero_infinity' parameter for PaddlePaddle.
@aztice aztice requested a review from SigureMo October 30, 2025 12:31
Removed the 'zero_infinity' parameter description from CTCLoss documentation.
…torch_more_args/torch.nn.functional.ctc_loss.md
@aztice aztice requested a review from SigureMo October 31, 2025 11:01
@luotao1 luotao1 added the HappyOpenSource 快乐开源活动issue与PR label Nov 3, 2025
@luotao1
Copy link
Collaborator

luotao1 commented Nov 3, 2025

@SigureMo 请再看下

- **blank** (int,可选) - 空格标记的 ID 值,其取值范围为 [0, num_classes + 1)。数据类型支持 int32。默认值为 0。
- **reduction** (str,可选) - 指定应用于输出结果的计算方式,可选值有:``'none'``, ``'mean'``, ``'sum'``。设置为 ``'mean'`` 时,对 loss 值除以 label_lengths,并返回所得商的均值;设置为 ``'sum'`` 时,返回 loss 值的总和;设置为 ``'none'`` 时,则直接返回输出的 loss 值。默认值为 ``'mean'``。
- **norm_by_times** (bool,可选) - 是否根据序列长度对梯度进行正则化。数据类型支持 bool。默认值为 False。
- **zero_infinity** (bool,可选) - 如果 ``true``,将 可能 输出无限的 ``loss`` 设置为 ``0``。默认值: False。
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

啊……

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

啊?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

我感觉我平时写md或者这类文档的时候习惯比较awful()

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

会打空格进去特别标注(

@SigureMo SigureMo requested a review from Copilot November 3, 2025 11:36
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR adds the zero_infinity parameter to Paddle's CTCLoss APIs and removes outdated API difference documentation that incorrectly stated this parameter wasn't supported.

  • Added zero_infinity parameter to paddle.nn.functional.ctc_loss and paddle.nn.CTCLoss
  • Removed API difference documentation files that claimed zero_infinity was unsupported in Paddle
  • Updated API documentation in Chinese to reflect the new parameter

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.functional.ctc_loss.md Removed obsolete API difference documentation since Paddle now supports zero_infinity
docs/guides/model_convert/convert_from_pytorch/api_difference/torch_more_args/torch.nn.CTCLoss.md Removed obsolete API difference documentation since Paddle now supports zero_infinity
docs/api/paddle/nn/functional/ctc_loss_cn.rst Added zero_infinity parameter to function signature and parameter documentation
docs/api/paddle/nn/CTCLoss_cn.rst Added zero_infinity parameter to class signature and parameter documentation

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@luotao1 luotao1 merged commit 3cf64e3 into PaddlePaddle:develop Nov 4, 2025
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

contributor HappyOpenSource 快乐开源活动issue与PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants